/*
 * File: QueueAdder.java Author: Robert Bittle <guywithnose@gmail.com>
 */
package foxtrotbravo;

import com.google.appengine.api.backends.BackendServiceFactory;
import com.google.appengine.api.taskqueue.Queue;
import com.google.appengine.api.taskqueue.QueueFactory;
import com.google.appengine.api.taskqueue.TaskOptions;
import com.google.appengine.api.taskqueue.TaskOptions.Method;

/**
 * The Class QueueAdder.
 */
public class QueueAdder
{

    /** The queue. */
    private static Queue queue = QueueFactory.getQueue("parseNewUsers");

    /**
     * Adds the.
     * 
     * @param url
     *            the url
     */
    public static void add(String url)
    {
        if (url != null)
        {
            
            TaskOptions options = TaskOptions.Builder.withUrl(url).method(
                    Method.GET);

            options = options.header("Host", BackendServiceFactory
                    .getBackendService().getBackendAddress("backend"));

            queue.add(options);
        }
    }

}
